﻿namespace h8

{

    public interface InterfaceA

    {

        void PrintCapitalLetter();

    }



    public interface InterfaceB

    {

        void PrintLowercaseLetter();

    }



    public class Print : InterfaceA, InterfaceB

    {

        public void PrintCapitalLetter()

        {

            Console.WriteLine("大写英文字母表:");

            for (char c = 'A'; c <= 'Z'; c++)

            {

                Console.Write(c + " ");

            }

            Console.WriteLine();

        }



        public void PrintLowercaseLetter()

        {

            Console.WriteLine("小写英文字母表:");

            for (char c = 'a'; c <= 'z'; c++)

            {

                Console.Write(c + " ");

            }

            Console.WriteLine();

        }

    }



    internal class Program

    {

        public static void Main(string[] args)

        {

            // 创建Print对象并赋值给InterfaceA类型的变量a

            InterfaceA a = new Print();

            // 调用打印大写字母的方法

            a.PrintCapitalLetter();



            // 创建Print对象并赋值给InterfaceB类型的变量b

            InterfaceB b = new Print();

            // 调用打印小写字母的方法

            b.PrintLowercaseLetter();

        }

    }

}


